{extend name="../../base/view/common/base" /}
<!-- 主体 -->
{block name="body"}
<link href="{__STATIC__}/home/other/formSelects-v4.css" rel="stylesheet"/>
<script src="{__STATIC__}/home/other/jquery.min.js"></script>
<script src="{__STATIC__}/home/other/formSelects-v4.min.js"></script>
<style>
    .layui-laydate-header {
        display: none;
    }

    .layui-laydate-content > table > thead {
        display: none;
    }

    .laydate-day-prev {
        display: none;
    }

    .laydate-day-next {
        display: none;
    }

    .pl_btn {
        color: #4c9cfb !important;
        cursor: pointer;
    }

    .countBan{
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-content: center;
        justify-content: flex-end;
    }
    .count_item_show{
        display: flex;
        margin: 10px;
        align-content: center;
        align-items: center;
    }
</style>
<form class="layui-form p-4">
    <h3 class="pb-3">功能菜单/节点</h3>
    <table class="layui-table layui-table-form">
        <tr>
            <td class="layui-td-gray-2">单号<font>*</font>
            </td>
            <td>
                <input readonly type="text" name="orderNum" value="{$detail.orderNum|default=''}" lay-verify="required" readonly
                       autocomplete="off" placeholder="请输入名称"
                       class="layui-input disabled">
            </td>
            <td class="layui-td-gray">客户<font>*</font>
            </td>
            <td>
                <select disabled name="punterId" lay-search lay-filter="punterId">
                    <option value="">选择客户</option>
                    {volist name='punterList' id='pl'}
                    <option value="{$pl.id}" {if isset($detail.punterId)&&$detail.punterId==$pl.id} selected {/if}>{$pl.name}</option>
                    {/volist}
                </select>
            </td>
            <td class="layui-td-gray">单据日期<font>*</font></td>
            <td>
                <input readonly type="text" name="orderDate" id="orderDate" value="{$detail.orderDate|default=$thisDate}" lay-verify="required" readonly
                       autocomplete="off" placeholder="选择日期"
                       class="layui-input">
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray">付款方式<font>*</font>
            </td>
            <td>
                <select disabled name="payType" lay-search >
                    {volist name='payTypeList' id='ptl'}
                    <option value="{$ptl.id}" {if isset($detail.payType) && $detail.payType == $ptl.id} selected {/if}>{$ptl.name}</option>
                    {/volist}
                </select>
            </td>
            <td class="layui-td-gray">有效天数<font>*</font>
            </td>
            <td>
                <input readonly type="text" name="dayLongs" value="{$detail.dayLongs|default='7'}" lay-verify="required"
                       autocomplete="off" placeholder="请输入" oninput="digitalFiltering(this,0)"
                       class="layui-input">
            </td>
        </tr>
        <tr>

            <td class="layui-td-gray">销售单位
            </td>
            <td>
                <select disabled name="salesUnitId" lay-search lay-filter="salesUnitId">
                    <option value="">销售单位</option>
                    {volist name='saleUniList' id='sl'}
                    <option value="{$sl.id}"  {if isset($detail.salesUnitId)&&$detail.salesUnitId==$sl.id} selected {/if}>{$sl.title}</option>
                    {/volist}
                </select>
            </td>
            <td class="layui-td-gray-2">销售员<font>*</font>
            </td>
            <td>

                <select disabled name="saleId" id="saleId" xm-select="saleId">
                    <option value="" >选择销售员</option>
                    {volist name='saleUserList' id='sl'}
                    <option value="{$sl.id}" {if isset($detail.saleId) &&in_array($sl.id,explode(',',$detail.saleId))} selected {/if}>{$sl.name}</option>
                    {/volist}
                </select>

            </td>
            <td class="layui-td-gray-2">税率(%)
            </td>
            <td>
                <select disabled name="tax" id="tax">

                    {if isset($detail.tax)}
                    {volist name='quoOrderTax' id='qt'}
                    <option value="{$qt}" {if $detail.tax==$qt} selected{/if}>{$qt}</option>
                    {/volist}
                    {else}
                    {volist name='quoOrderTax' id='qt'}
                    <option value="{$qt}" {if $qt ==13} selected{/if}>{$qt}</option>
                    {/volist}
                    {/if}

                </select>
                <!--                <input readonly type="text" name="tax" id="tax" value="{$detail.tax|default=''}"-->
                <!--                       oninput="digitalFiltering(this,2)" max="1" autocomplete="off" placeholder="请输入"-->
                <!--                       lay-reqText="请输入" class="layui-input">-->
            </td>
        </tr>
        <tr>

            <td class="layui-td-gray">联系人
            </td>
            <td>
                <select disabled name="contactId" id="contactId" lay-filter="contactId" lay-search >
                    <option value="">供应商联系人</option>
                </select>
            </td>
            <td class="layui-td-gray-2">联系电话
            </td>
            <td>
                <input readonly type="text" name="contactPhone" value="{$detail.contactPhone|default=''}" lay-verify="required" readonly class="layui-input layui-disabled" placeholder="选择联系人">
                <input readonly type="hidden" name="contactName" value="{$detail.contactName|default=''}">
            </td>

        </tr>
        <tr>

            <td class="layui-td-gray">收货人
            </td>
            <td>
                <select disabled name="saveId" id="saveId" lay-search lay-filter="saveId" >
                    <option value="">请选择</option>
                </select>
            </td>
            <td class="layui-td-gray-2">收货人电话

            </td>
            <td> <input readonly type="text" name="savePhone" value="{$detail.savePhone|default=''}" lay-verify="required" readonly class="layui-input layui-disabled" placeholder="选择收货人">
                <input readonly type="hidden" name="saveName" value="{$detail.saveName|default=''}">
            </td>
            <td class="layui-td-gray-2">收货人地址
            </td>
            <td>
                <input readonly type="text" name="saveAdd" value="{$detail.saveAdd|default=''}" lay-verify="required" readonly class="layui-input layui-disabled" placeholder="选择收货人">

            </td>
        </tr>
        <tr>
            <td colspan="6"><h4>明细</h4></td>
        </tr>
        <tr>

            <td colspan="6">
<!--                <a href="javascript:" data-url="{:url('addMx')}" data-width="1000"-->
<!--                   class="layui-btn layui-btn-primary btn_box">选择产品</a>-->
<!--                <a class="layui-btn layui-btn-primary" href="{:url('api/ExportModel/QuotationOrderMxImportModel')}" target="_blank">导入模板</a>-->
<!--                <a href="javascript:" class="layui-btn layui-btn-primary" id="importMx">导入</a>-->
                <table class="layui-table tableMany">
                    <thead>
                    <tr>
                        <td>序号</td>
                        <td>品牌</td>
                        <td>品名</td>
                        <td>型号</td>
                        <td>订货号</td>
                        <td>单位</td>
                        <td>数量</td>
                        <td>含税单价</td>
                        <!--                        <td>产品面价</td>-->
                        <!--                        <td>产品折扣(%)</td>-->
                        <td>未税单价</td>
                        <td >含税小计</td>
                        <td>货期
                            <!--                            <a href="javascript:" class="pl_btn" id="mxPl">批量</a>-->
                        </td>
                        <td>备注</td>
                        <!--                        <td>有效天数</td>-->
                        <td>操作</td>
                    </tr>
                    </thead>
                    <tbody id="mxTbdy">
                    {if $mxList}
                    {volist name='mxList' id='mxl' key='mkey'}
                    <tr>
                        <td>
                            <span class="xuhao">{$mkey}</span>
                            <input readonly type="hidden" name="mx[mxid][]" value="{$mxl.id}">
                            <input readonly type="hidden" name="mx[mdId][]" value="{$mxl.mdId}">
                        </td>
                        <td>{$mxl.brand}</td>
                        <td>{$mxl.mdName}</td>
                        <td>{$mxl.specs}</td>
                        <td>{$mxl.buyCode}</td>
                        <td>{$mxl.unit}</td>
                        <td><input readonly type="text" name="mx[bjNum][]" value="{$mxl.bjNum}" class="layui-input bjNum" onblur="getMoneys(this)"
                                   lay-verify="required" oninput="digitalFiltering(this,2)"></td>
                        <td><input readonly type="text" name="mx[bjPrice][]" value="{$mxl.bjPrice}" class="layui-input bjPrice" onblur="getNotaxPrice(this)"
                                   lay-verify="required" oninput="digitalFiltering(this,2)"></td>
                        <!--                        <td><input readonly type="text" class="layui-input mdPrice" readonly name="mx[mdPrice][]"-->
                        <!--                                   value="{$mxl.mdPrice}"></td>-->
                        <!--                        <td><input readonly type="number" min="0" max="100" maxlength="3" name="mx[discount][]" class="layui-input discount"-->
                        <!--                                   onblur="getMoneys(this)" value="{$mxl.discount}" lay-verify="required" oninput="digitalFiltering(this,0)">-->
                        <!--                        </td>-->
                        <td><input readonly type="text" class="layui-input noTaxPrice" value="{$mxl.noTaxPrice}" oninput="digitalFiltering(this,2)" onblur="getTaxtPrice(this)" name="mx[noTaxPrice][]"></td>
                        <td><input readonly type="text" class="layui-input bjMoney" value="{$mxl.bjMoney}" readonly name="mx[bjMoney][]"></td>
                        <td><input readonly type="text" name="mx[bjTime][]" class="layui-input mxBjTime"
                                   lay-verify="required" value="{$mxl.bjTime}" placeholder="请输入"></td>
                        <td><input readonly type="text" class="layui-input" name="mx[remark][]" value="{$mxl.remark}"></td>
                        <!--                        <td><input readonly type="text" name="mx[timeLong][]" class="layui-input" value="{$mxl.timeLong}" lay-verify="required"-->
                        <!--                                   oninput="digitalFiltering(this,0)"></td>-->
                        <td>
<!--                            <a href="javascript:" class="layui-btn layui-btn-xs layui-btn-danger"-->
<!--                               onclick="delMx('{$mxl.id}',this)">删除</a>-->
                        </td>
                    </tr>
                    {/volist}
                    {/if}
                    </tbody>
                </table>

            </td>
        </tr>
        <tr>
            <td colspan="13">
                <div class="countBan">
                    <div class="count_item_show">数量合计：<span id="numCount">{$countNum|default=0}</span></div>
                    <div class="count_item_show">金额合计：<span id="priceCount">{$countPrice|default=0}</span></div>
                </div>
            </td>
        </tr>
    </table>
    <div class="py-3">
        <input readonly type="hidden" name="id" value="{$id}">
<!--        {if !isset($detail.status)||$detail.status==1}-->
<!--        <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">保存</button>-->
<!--        <button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
<!--        {/if}-->
<!--        {if isset($detail.status)&&$detail.status==1}-->
<!--        <a href="javascript:" class="layui-btn layui-btn-normal" onclick="onSure()" >确认</a>-->
<!--        {/if}-->
    </div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script type="text/javascript">
    // formSelects.render('selectId');
    formSelects.render('saleId');
</script>
<script>
    const moduleInit = ['tool'];
    let contactList=[];
    let saveList=[];
    let punterId="{$detail.punterId|default=''}"
    let salesUnitId="{$detail.salesUnitId|default=''}"
    function gouguInit() {
        var form = layui.form, tool = layui.tool, level = 0, laydate = layui.laydate;
        //监听提交
        form.on('submit(webform)', function (data) {
            let callback = function (e) {
                layer.msg(e.msg);
                if (e.code == 0) {
                    setTimeout(function () {
                        parent.parent.location.reload();
                    }, 1000);
                }
            }
            tool.post("{:url('add')}", data.field, callback);
            return false;
        });
        // laydate.render({
        //     elem: '.mxBjTime',// 指定元素
        //     type: 'date',
        // });

        $("#mxPl").click(function () {
            layer.open({
                type: 1,
                title: '报价货期',
                area: ['500px', '200px'],
                btn: ['确定'],
                content: '<form class="layui-form" id="printForm" action="">' +
                    '  <div class="layui-form-item" >' +
                    '    <label class="layui-form-label" style="margin: 0;width: 90px">选择时间</label>' +
                    '    <div class="layui-input-block">' +
                    '      <input readonly type="text " style="width: 200px" class="layui-input" id="pl_bjTime" readonly name="pl_bjTime" title="选择时间">' +
                    '    </div>' +
                    '  </div>' +
                    '</form>',
                success: function (layero, index) {
                    // 渲染表单
                    layui.laydate.render({
                        elem: "#pl_bjTime"
                    })
                    form.render();
                    //
                    // // 监听提交事件
                    // form.on('radio(printType)', function(data){
                    //     console.log(data.value); // 获取选中的值
                    //     layer.close(index); // 关闭弹窗
                    // });
                },
                yes: function (index) {
                    var form = document.getElementById('printForm');
                    let times = $("#pl_bjTime").val()
                    $('.tableMany tr').find('.mxBjTime').val(times);
                    layer.close(index);
                }
            });
        })

        form.on('select(punterId)', function (data) {
            console.log('data',data)
            getPunterMember(data.value);
            // getKHXSY(data.value);
        });
        // form.on('select(salesUnitId)', function (data) {
        //    let val=data.value;
        //     getDepartUser(val);
        // });

        form.on('select(contactId)', function (data) {
            let value=data.value;
            if (data.value==''){
                $("input[name ='contactName']").val();
                $("input[name ='contactPhone']").val();
            }else {
                contactList.forEach(function (item) {
                    if (item.id==value){
                        $("input[name ='contactName']").val(item.name);
                        $("input[name ='contactPhone']").val(item.phone);
                        return;
                    }
                })
            }
        });
        form.on('select(saveId)', function (data) {
            let value=data.value;
            if (data.value==''){
                $("input[name ='saveName']").val();
                $("input[name ='savePhone']").val();
                $("input[name ='saveAdd']").val();
            }else {
                saveList.forEach(function (item) {
                    if (item.id==value){
                        $("input[name ='saveName']").val(item.name);
                        $("input[name ='savePhone']").val(item.phone);
                        $("input[name ='saveAdd']").val(item.address);
                        return;
                    }
                })
            }
        });
        laydate.render({
            elem:"#orderDate"
        })
        // $(document).on('click', '.mxBjTime', function(){
        //     laydate.render({
        //         elem: this // 绑定当前点击的元素
        //     });
        // });

        getPunterMember(punterId);
        // getKHXSY(punterId);
        // getDepartUser(salesUnitId)


        var loadingIndex='';
        var upload=layui.upload;
        upload.render({
            elem: '#importMx'
            ,url: "{:url('importMxData')}"
            ,accept: 'file'
            ,exts: 'xlsx',
            before:function (res) {
                loadingIndex=layer.load(1,{
                    shade: [0.5,'#a09b9b']
                });
            }
            ,done: function(res){
                layer.msg(res.msg)
                layer.close(loadingIndex)
                let data=res.data;
                console.log('data',data)
                saveAddMx(data)
                return;
            },
            error(e){
                layer.msg('网络异常请稍后再试')
                layer.close(loadingIndex)
            }
        });
    }

    let mxIndex = '';

    function saveAddMx(ojb) {

        var lastListItem = $('.tableMany tr:last');
        let aa = $(lastListItem).find(".xuhao")
        if (mxIndex!=''){
            layer.close(mxIndex)
        }
        let len = $(aa).text()
        if (!parseInt(len)) {
            len = 0;
        }
        let index = parseInt(len) + 1;
        let str = '';
        for (var i = 0; i < ojb.length; i++) {
            let item = ojb[i];
            str += '      <tr>\n' +
                '                        <td>\n' +
                '                            <span class="xuhao">' + index + '</span>\n' +
                '                            <input readonly type="hidden" name="mx[mxid][]" value="">\n' +
                '                            <input readonly type="hidden" name="mx[mdId][]" value="' + item.id + '">\n' +
                '                        </td>\n' +
                '                        <td>' + item.brand + '</td>\n' +
                '                        <td>' + item.name + '</td>\n' +
                '                        <td>' + item.specs + '</td>\n' +
                '                        <td>' + item.buyCode + '</td>\n' +
                '                        <td>' + item.unit + '</td>\n' +
                '                        <td><input readonly type="text" name="mx[bjNum][]" class="layui-input bjNum" onblur="getMoneys(this)" lay-verify="required" oninput="digitalFiltering(this,2)"></td>\n' +
                '                        <td><input readonly type="text" name="mx[bjPrice][]" class="layui-input bjPrice" onblur="getNotaxPrice(this)" lay-verify="required" oninput="digitalFiltering(this,2)"></td>\n' +
                // '                        <td><input readonly type="text" class="layui-input mdPrice" readonly name="mx[mdPrice][]" value="' + item.proPrice + '"></td>\n' +
                // '                        <td><input readonly type="number" min="0" max="100" name="mx[discount][]" class="layui-input discount" onblur="getMoneys(this)" lay-verify="required" oninput="digitalFiltering(this,0)"></td>\n' +
                '                        <td> <input readonly type="text" class="layui-input noTaxPrice"  name="mx[noTaxPrice][]" oninput="digitalFiltering(this,2)" onblur="getTaxtPrice(this)"></td>\n' +
                '                        <td>  <input readonly type="text" class="layui-input bjMoney" readonly name="mx[bjMoney][]"></td>\n' +
                '                        <td><input readonly type="text" name="mx[bjTime][]" class="layui-input mxBjTime"  lay-verify="required" placeholder="请输入"></td>\n' +
                '                        <td><input readonly type="text" class="layui-input" name="mx[remark][]"></td>\n' +
                // '                        <td><input readonly type="text" name="mx[timeLong][]" class="layui-input" lay-verify="required" oninput="digitalFiltering(this,0)"></td>\n' +
                '                        <td><a href="javascript:" class="layui-btn layui-btn-xs layui-btn-danger" onclick="delMx(\'\',this)">删除</a></td>\n' +
                '                    </tr>';
            index++;
        }
        $("#mxTbdy").append(str)
        layui.form.render();
    }

    function delMx(id = '', e) {

        if (id == '') {
            $(e).parent().parent().remove()
            getCounts()
            return;
        }
        $.ajax({
            url: "{:url('removeMx')}",
            type: 'post',
            dataType: 'json',
            data: {id: id},
            success: function (res) {
                if (res.code != 0) {
                    layer.msg(res.msg)
                } else {
                    $(e).parent().parent().remove()
                    getCounts()
                }
            },
            error(e) {
                layer.msg('网络错误，请稍后')
            }
        })
    }

    // function getMoneys(ojb) {
    //     let tax = $("#tax").val()
    //     if (!parseInt(tax)) {
    //         tax = 0;
    //     } else {
    //         tax = parseFloat(tax / 100)
    //     }
    //     console.log('tax',tax)
    //     let trObj = $(ojb).parent().parent();
    //     let bjNum = trObj.find(".bjNum").val()
    //     let bjPrice = trObj.find(".bjPrice").val()
    //     let discount = trObj.find(".discount").val()
    //
    //     if (!parseInt(discount)) {
    //         discount = 1;
    //     } else {
    //         discount = parseFloat(discount / 100);
    //     }
    //     let noTaxPrice = 0;
    //     let bjMoney = 0;
    //     noTaxPrice = parseFloat((bjPrice * discount) / (1 - tax))
    //     bjMoney = parseFloat(bjPrice * discount * bjNum);
    //     trObj.find(".noTaxPrice").val(noTaxPrice.toFixed(2))
    //     trObj.find(".bjMoney").val(bjMoney.toFixed(2))
    //     getCounts();
    // }
    /**
     * 未税单价
     */
    function getNotaxPrice(obj) {
        let tax = $("#tax").val()
        if (!parseInt(tax)) {
            tax = 0;
        } else {
            tax = parseFloat(tax / 100)
        }
        let trObj = $(obj).parent().parent();
        let bjPrice = trObj.find(".bjPrice").val()
        let noTaxPrice = 0;
        noTaxPrice = parseFloat(bjPrice  / (1 + tax))
        trObj.find(".noTaxPrice").val(noTaxPrice.toFixed(2))
        getMoneys(obj)
    }
    function getTaxtPrice(obj){
        let tax = $("#tax").val()
        if (!parseInt(tax)) {
            tax = 0;
        } else {
            tax = parseFloat(tax / 100)
        }
        let trObj = $(obj).parent().parent();
        let noTaxPrice = trObj.find(".noTaxPrice").val()
        let taxPrice = 0;
        taxPrice = parseFloat(noTaxPrice  * (1 + tax))
        trObj.find(".bjPrice").val(taxPrice.toFixed(2))
        getMoneys(obj)
    }
    function getMoneys(ojb){
        let trObj = $(ojb).parent().parent();
        let bjNum = trObj.find(".bjNum").val()
        let bjPrice = trObj.find(".bjPrice").val()
        let bjMoney = 0;
        bjMoney = parseFloat(bjPrice *  bjNum);
        trObj.find(".bjMoney").val(bjMoney.toFixed(2))
        getCounts();
    }
    function getPunterMember(punterId='') {
        $("#contactId").empty();
        $("#saveId").empty();
        $("input[name ='contactName']").val();
        $("input[name ='contactPhone']").val();
        $("input[name ='saveName']").val();
        $("input[name ='savePhone']").val();
        $("input[name ='saveAdd']").val();
        contactList=[];
        saveList=[];
        if (punterId==''){
            layui.form.render();
            return;
        }
        httpRequest("{:url('api/getPurveyorMember')}",{purveyorId:punterId},function (res) {
            if (res.code==0){
                contactList=res.data.contactList;
                saveList=res.data.saverList;
                let contactStr='  <option value="">请选择</option>';
                let saverStr='  <option value="">请选择</option>';
                let contactId="{$detail.contactId|default='0'}"
                let saveId="{$detail.saveId|default='0'}"
                contactList.forEach(function (item) {
                    let cStr='';
                    if (item.id==contactId){
                        cStr='selected';
                    }
                    contactStr+='  <option value="'+item.id+'" '+cStr+'>'+item.name+'</option>'
                })
                saveList.forEach(function (item) {
                    let s_Str='';
                    if (item.id==saveId){
                        s_Str='selected';
                    }
                    saverStr+='  <option value="'+item.id+'" '+s_Str+'>'+item.name+'</option>'
                })
                $("#contactId").append(contactStr);
                $("#saveId").append(saverStr);
                layui.form.render();
            }else {

            }
        },false)
    }
    function getKHXSY(punterId='') {
        $("#saleId").empty();
        if (punterId==''){
            layui.form.render();
            formSelects.render('saleId');
            return;
        }
        httpRequest("{:url('api/getKHXSY')}",{purveyorId:punterId},function (res) {
            if (res.code==0){
                let data=res.data;
                // let str='  <option value="">请选择</option>';
                let str='';
                let saleIds="{$detail.saleId|default=0}"
                let saleidArr=saleIds.split(",");
                data.forEach(function (item) {
                    let cStr='';
                    if (saleidArr.includes(''+item.id+'')){
                        cStr='selected';
                    }
                    str+='  <option value="'+item.id+'" '+cStr+'>'+item.name+'</option>'
                })
                $("#saleId").append(str);
                layui.form.render();
                formSelects.render('saleId');
            }else {

            }
        },false)

    }
    function getDepartUser(departId='') {
        $("#saleId").empty();
        if (departId==''){
            layui.form.render();
            return;
        }
        httpRequest("{:url('api/getDepartUser')}",{did:departId},function (res) {
            if (res.code==0){
                let data=res.data;
                let saleStr='';
                let saleId="{$detail.saleId|default='0'}"
                data.forEach(function (item) {
                    let sstr='';
                    if (item.id==saleId){
                        sstr='selected';
                    }
                    saleStr+=' <option value="'+item.id+'" '+sstr+'>'+item.name+'</option>';
                })

                $("#saleId").append(saleStr);
                layui.form.render();
            }
        },false)
    }

    function onSure() {
        let id="{$id}";
        if (id==0){
            layer.msg('操作有误');
            return;
        }
        httpRequest("{:url('onSure')}",{id:id},function (res) {
            if (res.code == 0) {
                setTimeout(function () {
                    parent.parent.location.reload();
                }, 1000);
            }
        })
    }

    function getCounts() {
        let nums=0;
        let moneys=0;
        $('.bjNum').each(function () {
            let thisNum=$(this).val();
            if (thisNum==''){
                thisNum=0;
            }
            thisNum=parseFloat(thisNum)
            nums+=thisNum;
        })
        $('.bjMoney').each(function () {
            let thisMoney=$(this).val();
            if (thisMoney==''){
                thisMoney=0;
            }
            thisMoney=parseFloat(thisMoney)
            moneys+=thisMoney;
        })

        $('#numCount').text(nums)
        $('#priceCount').text(moneys)
    }
</script>
{/block}
<!-- /脚本 -->